﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using AutoIt_IDE;
using AutoIt_Elements.Core.LanguageManager;

namespace AutoIt_Elements.GUI
{
    public partial class BaseSettings : Form
    {
        public BaseSettings()
        {
            InitializeComponent();
        }

        private void BaseSettings_Load(object sender, EventArgs e)
        {
            // Load Languages
            settings_cbox_lang.Text = Program.langManager.CurrentLanguage.Name;
            foreach (KeyValuePair<string,Language> lang in Program.langManager.LoadedLanguages)
            {
                settings_cbox_lang.Items.Add(lang.Key);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            new LangEditor().ShowDialog();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Language cur = Program.langManager.CurrentLanguage;
            Program.langManager.SaveLanguage(cur, Environment.CurrentDirectory + @"\Lang\test.xml");
        }
    }
}
